//
// Created by Asus on 2025/6/2.
//

#include <iostream>
#include <vector>
using namespace std;

void printVector(const vector<int> &v) {
    for (auto it = v.begin(); it != v.end(); it++) {
        cout << *it << " ";
    }
    cout << endl;
}

void demo01() {
    vector<int> v = {1, 2, 3, 4, 5};
    printVector(v);

    if (v.empty()) {
        cout << "empty" << endl;
    } else {
        cout << "not empty" << endl;
        cout << "v容量:" << v.capacity() << endl;
        cout << "v大小:" << v.size() << endl;
    }

    v.resize(3);
    printVector(v);

    v.resize(8, 3);
    printVector(v);
}

int main(int argc, char *argv[]) {
    demo01();
    return 0;
}
